/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author dong
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface JydqProductComment extends BasicModel<JydqProductComment> {
  productId?: string; // 商品ID
  content?: string; // 评论内容
  rating?: number; // 评分 1-5分
  images?: string; // 图片
}

export const jydqProductCommentList = (params?: JydqProductComment | any) =>
  defHttp.get<JydqProductComment>({ url: adminPath + '/jydq/productComment/list', params });

export const jydqProductCommentListData = (params?: JydqProductComment | any) =>
  defHttp.post<Page<JydqProductComment>>({ url: adminPath + '/jydq/productComment/listData', params });

export const jydqProductCommentForm = (params?: JydqProductComment | any) =>
  defHttp.get<JydqProductComment>({ url: adminPath + '/jydq/productComment/form', params });

export const jydqProductCommentSave = (params?: any, data?: JydqProductComment | any) =>
  defHttp.postJson<JydqProductComment>({ url: adminPath + '/jydq/productComment/save', params, data });

export const jydqProductCommentDelete = (params?: JydqProductComment | any) =>
  defHttp.get<JydqProductComment>({ url: adminPath + '/jydq/productComment/delete', params });
